﻿/* ============================================================================
(c) Copyright 2012 Hewlett-Packard Development Company, L.P.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge,publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
============================================================================ */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using HPCloud.Objects.Domain.Compute.Security;
using System.Runtime.Serialization;

namespace  HPCloud.Objects.Domain.Compute 
{
    [System.Runtime.Serialization.DataContractAttribute(Name = "server")]
    public partial class SingleNewServerClass : BaseEntity
    {
        [System.Runtime.Serialization.DataMemberAttribute()]
        public NewServer server;
    }

    //[System.Xml.Serialization.XmlRootAttribute(ElementName = "server", Namespace = "http://docs.openstack.org/compute/api/v1.1", IsNullable = false)]
    //[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://docs.openstack.org/compute/api/v1.1")]
    [System.Runtime.Serialization.DataContractAttribute(Name = "server")]
    public class NewServer 
    {
        private string _name;
        private string _imageId;
        private string _flavorId;
        //private string _password;
        private string _accessIPv4;
        private string _accessIPv6;
        private MetaData _metaData;
        private string _keyName;
        private List<SecurityGroupAssignment> _securityGroups = new List<SecurityGroupAssignment>();

        #region Properties

//=========================================================================================
/// <summary>
/// 
/// </summary>
//=========================================================================================  
        [XmlArrayItem("security_group")]
        [XmlArray("security_groups")]
        [DataMember(Name = "security_groups")]
        public List<SecurityGroupAssignment> SecurityGroups
        {
            get { return _securityGroups; }
            set { _securityGroups = value; }
        }
//=========================================================================================
/// <summary>
/// 
/// </summary>
//=========================================================================================  
        [System.Xml.Serialization.XmlAttributeAttribute("key_name")]
        [DataMember(Name = "key_name")]
        public string KeyName
        {
            get { return _keyName; }
            set { _keyName = value; }
        }
//=========================================================================================
/// <summary>
/// 
/// </summary>
//=========================================================================================  
        //[XmlArrayItem("meta")]
        //[XmlArray("metadata")]
        [DataMember(Name = "metadata")]
        public MetaData MetaData
        {
            get { return _metaData; }
            set { _metaData = value; }
        }
//=========================================================================================
/// <summary>
/// 
/// </summary>
//=========================================================================================   
        [System.Xml.Serialization.XmlAttributeAttribute("name")]
        [DataMember(Name = "name")]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
//=========================================================================================
/// <summary>
/// 
/// </summary>
//=========================================================================================    
        [System.Xml.Serialization.XmlAttributeAttribute("imageRef")]
        [DataMember(Name = "imageRef")]
        public string ImageRef
        {
            get { return _imageId; }
            set { _imageId = value; }
        }
//=========================================================================================
/// <summary>
/// 
/// </summary>
//=========================================================================================    
        [System.Xml.Serialization.XmlAttributeAttribute("flavorRef")]
        [DataMember(Name = "flavorRef")]
        public string FlavorRef
        {
            get { return _flavorId; }
            set { _flavorId = value; }
        }
//=========================================================================================
/// <summary>
/// 
/// </summary>
//=========================================================================================      
        //[System.Xml.Serialization.XmlAttributeAttribute("password")] 
        //public string Password
        //{
        //    get { return _password; }
        //    set { _password = value; }
        //}
//=========================================================================================
/// <summary>
/// 
/// </summary>
//=========================================================================================   
        [System.Xml.Serialization.XmlAttributeAttribute("accessIPv4")] 
        public string AccessIPv4
        {
            get { return _accessIPv4; }
            set { _accessIPv4 = value; }
        }
//=========================================================================================
/// <summary>
/// 
/// </summary>
//========================================================================================= 
        [System.Xml.Serialization.XmlAttributeAttribute("accessIPv6")] 
        public string AccessIPv6
        {
            get { return _accessIPv6; }
            set { _accessIPv6 = value; }
        }
        #endregion
    }
}

